﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NestedMasterPage.master" %>

<%@ Register TagPrefix="Page" TagName="Nav" Src="~/UserControls/PageControl.ascx" %>

<script runat="server">
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      B2C_MALL_HOME ws = new B2C_MALL_HOME();
      ws.Url = ConfigurationManager.AppSettings["B2C_MALL_HOME"].ToString();
      string jsonString =
        ws.B2C_MALL_GetMallShopNote(ConfigurationManager.AppSettings["WebDeviceid"].ToString()
        , HttpContext.Current.User.Identity.Name);
      JObject restoredObject = JsonConvert.DeserializeObject<JObject>(jsonString);
      string Is_Valid = restoredObject["Is_Valid"].ToString();
      string msg = restoredObject["Msg"].ToString();
      if (Is_Valid == "Y")
      {
        dynamic ShopNote = restoredObject["ShopNoteAry"];
        ListViewShopNote.DataSource = ShopNote;
        ListViewShopNote.DataBind();
      }
    }
  }

  //protected void ListViewShopNote_ItemDataBound(object sender, ListViewItemEventArgs e)
  //{
  //  if (e.Item.ItemType == ListViewItemType.DataItem)
  //  {
  //    dynamic note = e.Item.DataItem as dynamic;
  //    (e.Item.FindControl("lbl_Content") as Label).Text = note.Content;      
  //  }
  //}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="NestedContent" runat="server">
  <div class="breadcrumbs dotted">
    <a href="../Home.aspx">首頁</a> / <a href="ShoppingInformation.aspx" class="current">購物須知</a>
  </div>
  <div class="inner">
    <h1>購物須知</h1>
    <p>您可以根據下列購物流程進行商品選購</p>
    <div class="shopping-information">
      <img src="~/Images/ContentImages/steps.jpg" runat="server" />
    </div>
    <div class="info-area">
      <h4>訂購須知</h4>
      <ul>
        <asp:ListView ID="ListViewShopNote" runat="server">
          <ItemTemplate>
            <li>
              <%--<asp:Label ID="lbl_Content" runat="server" />--%>
              <%#  ((dynamic)Eval("Content")).ToString() %>
            </li>
          </ItemTemplate>
        </asp:ListView>        
      </ul>
    </div>
  </div>

</asp:Content>
